<template>
	<view>
		<top-navbar title="操作完成"></top-navbar>
		<view class="acea-row row-column row-center row-middle">
			<image class="pic" src="/static/images/noInvoice.png" mode="widthFix"></image>
			<text class="text-gray">订单设置完成</text>
			<view class="btn_group">
				<text class="btn" @click="orderDetail">查看订单详情</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		openOrderSubscribe
	} from '@/utils/SubscribeMessage.js';
	export default {
		data() {
			return {
				order_id: ''
			};
		},
		onLoad(option) {
			this.order_id = option.orderId
		},
		methods: {
			orderDetail() {
				if (!this.order_id)
					return that.$util.Tips({
						title: '缺少订单号无法查看订单详情'
					});
				// #ifdef MP
				uni.showLoading({
					title: '正在加载'
				});
				openOrderSubscribe()
					.then(() => {
						uni.hideLoading();
						uni.navigateTo({
							url: '/pages/users/order_details/index?order_id=' + this.order_id + '&isStore=1'
						})
					})
					.catch(err => {
						uni.hideLoading();
					});
				// #endif
				// #ifndef MP
				uni.navigateTo({
					url: '/pages/users/order_details/index?order_id=' + this.order_id + '&isStore=1'
				});
				// #endif
			}
		}
	}
</script>

<style lang="scss">
page {
	background-color: #fff;
}
.pic {
	margin-top: 100rpx;
}
.text-gray {
	color: #888;
}
.btn_group {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin-top: 100rpx;
	.btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 340rpx;
		height: 80rpx;
		margin: 0 auto;
		background-color: #95c51b;
		border: 0;
		font-size: 30rpx;
		border-radius: 40rpx;
		color: #fff;
	}
}
</style>
